package cn.edu.scau.cmi.wuyihan.client.comprehensive;

import cn.edu.scau.cmi.wuyihan.client.AbstractFactoryClient;
import cn.edu.scau.cmi.wuyihan.client.AdapterClient;
import cn.edu.scau.cmi.wuyihan.client.ConsistentCompositeClient;
import cn.edu.scau.cmi.wuyihan.client.FactoryClient;
import cn.edu.scau.cmi.wuyihan.client.HibernateClient;
import cn.edu.scau.cmi.wuyihan.client.InterProgrammingClient;
import cn.edu.scau.cmi.wuyihan.client.MultipletonClient;
import cn.edu.scau.cmi.wuyihan.client.SafeCompositeClient;
import cn.edu.scau.cmi.wuyihan.client.SimpleFactoryMethodClient;
import cn.edu.scau.cmi.wuyihan.client.SingletonClient;
import cn.edu.scau.cmi.wuyihan.client.SpringHibernateSessionClient;
import cn.edu.scau.cmi.wuyihan.client.SpringSingletonApplicationContextClient;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.Alert.AlertType;
import javafx.stage.Stage;

public class ComprehensiveController {
	
	@FXML
	private Button button1;
	
	@FXML
	private Button button2;
	
	@FXML
	private Button button3;
	
	@FXML
	private Button button4;
	
	@FXML
	private Button button5;
	
	@FXML
	private Button button6;
	
	@FXML
	private Button button7;
	
	@FXML
	private Button button8;
	
	@FXML
	private Button button9;
	
	@FXML
	private Button button10;
	
	@FXML
	private Button button11;
	
	@FXML
	private Button button12;
	
	@FXML
	private Button button13;
	
	public ComprehensiveController () {}
	
	@FXML
	private void action1() throws Exception {
		SingletonClient singletonClient = new SingletonClient();
		singletonClient.start(new Stage());
	}
	
	@FXML
	private void action2() throws Exception {
		MultipletonClient multipletonClient = new MultipletonClient();
		multipletonClient.start(new Stage());
	}
	
	@FXML
	private void action3() {
		Alert alert = new Alert(AlertType.WARNING);
		alert.setTitle("温馨提示");
		alert.setHeaderText("请到控制台进行交互！");
		alert.showAndWait();
		InterProgrammingClient.action();
	}
	
	@FXML
	private void action4() throws Exception {
		SimpleFactoryMethodClient simpleFactoryMethodClient = new SimpleFactoryMethodClient();
		simpleFactoryMethodClient.start(new Stage());
	}
	
	@FXML
	private void action5() throws Exception {
		FactoryClient factoryClient = new FactoryClient();
		factoryClient.start(new Stage());
	}
	
	@FXML
	private void action6() throws Exception {
		AbstractFactoryClient abstractFactoryClient = new AbstractFactoryClient();
		abstractFactoryClient.start(new Stage());
	}
	
	@FXML
	private void action7() throws Exception {
		AdapterClient adapterClient = new AdapterClient();
		adapterClient.start(new Stage());
	}
	
	@FXML
	private void action8() throws Exception {
		AdapterClient adapterClient = new AdapterClient();
		adapterClient.start(new Stage());
	}
	
	@FXML
	private void action9() {
		Alert alert = new Alert(AlertType.WARNING);
		alert.setTitle("温馨提示");
		alert.setHeaderText("请到控制台进行交互！");
		alert.showAndWait();
		SafeCompositeClient.action();
	}
	
	@FXML
	private void action10() {
		Alert alert = new Alert(AlertType.WARNING);
		alert.setTitle("温馨提示");
		alert.setHeaderText("请到控制台进行交互！");
		alert.showAndWait();
		ConsistentCompositeClient.action();
	}
	
	@FXML
	private void action11() {
		Alert alert = new Alert(AlertType.WARNING);
		alert.setTitle("温馨提示");
		alert.setHeaderText("请到控制台进行交互！");
		alert.showAndWait();
		HibernateClient.action();
	}
	
	@FXML
	private void action12() {
		Alert alert = new Alert(AlertType.WARNING);
		alert.setTitle("温馨提示");
		alert.setHeaderText("请到控制台进行交互！");
		alert.showAndWait();
		SpringSingletonApplicationContextClient.action();
	}
	
	@FXML
	private void action13() {
		Alert alert = new Alert(AlertType.WARNING);
		alert.setTitle("温馨提示");
		alert.setHeaderText("请到控制台进行交互！");
		alert.showAndWait();
		SpringHibernateSessionClient.action();
	}
}
